home *** CD-ROM | disk | FTP | other *** search
/ DOpus Plus / DOpus Plus.iso / SDK / docs / locale.doc < prev    next >
Encoding:
Text File  |  1998-10-26  |  1.9 KB  |  54 lines

  1. dopus5.library/DOpusGetString                   dopus5.library/DOpusGetString
  2.  
  3.     NAME
  4.         DOpusGetString - get a text string from the locale table
  5.  
  6.     SYNOPSIS
  7.         DOpusGetString(locale, id)
  8.                          A0    D0
  9.  
  10.         STRPTR DOpusGetString(struct DOpusLocale *, long);
  11.  
  12.     FUNCTION
  13.         This routine searches the string table referenced by the supplied
  14.         DOpusLocale structure for the string matching the supplied ID,
  15.         and returns a pointer to it.
  16.  
  17.         The DOpusLocale structure must be initialised in the following way :
  18.  
  19.             li_LocaleBase   - locale.library base address, or NULL
  20.             li_Catalog      - OpenCatalog() result, or NULL
  21.             li_BuiltIn      - default string table
  22.             li_Locale       - current system locale or NULL
  23.  
  24.         If there is no external catalog file, or locale.library is not
  25.         available, all fields except li_BuiltIn must be initialised to
  26.         NULL. li_BuiltIn MUST point to a table of default strings. This
  27.         table is in the CatComp block format. The easiest way to initialise
  28.         this pointer is to have a separate source module to a) include
  29.         the string table, and b) initialise the pointer. For example,
  30.  
  31.             #define CATCOMP_BLOCK
  32.             #include "strings.h"
  33.  
  34.             void init_locale_ptr(struct DOpusLocale *locale)
  35.             {
  36.                 locale->li_BuiltIn=(char *)CatCompBlock;
  37.             }
  38.  
  39.     INPUTS
  40.         locale - pointer to initialised DOpusLocale structure.
  41.         id - string ID to return.
  42.  
  43.     RESULT
  44.         Returns a pointer to the requested string. If there is no catalog,
  45.         or the given string is not in the supplied catalog, the default
  46.         string is returned. This pointer is READ-ONLY!
  47.  
  48.         You MUST NOT pass invalid string IDs to this routine.
  49.  
  50.     SEE ALSO
  51.         locale.library/OpenLocale(), locale.library/OpenCatalog(),
  52.         locale.library/GetLocaleStr()
  53.  
  54.